package cn.itsource.feign.client;

import cn.itsource.domain.Login;
import cn.itsource.dto.LoginMealDto;
import cn.itsource.feign.fallback.LoginFeignFallbcakFactory;
import cn.itsource.result.JSONResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * @Author: Jason
 * @Date: 2022/8/29 21:20
 */

@FeignClient(value = "service-auth", fallbackFactory = LoginFeignFallbcakFactory.class)
public interface LoginFeign {


    /**
     * 保存和修改操作公用此方法
     *
     * @param login 前端传递来的实体数据
     */
    @PostMapping(value = "/login/save")
    JSONResult save(@RequestBody Login login);

    /**
     * 保存信息到t_login_meal表
     */
    @PostMapping(value = "/login/saveLoginMeal")
    JSONResult saveLoginMeal(@RequestBody LoginMealDto dto);
}